package cn.consumer;

import java.util.concurrent.BlockingQueue;

public class Consumer extends Thread{

	private BlockingQueue<Integer> queue;
	public Consumer(BlockingQueue<Integer> queue){
		this.queue=queue;
	}
	@Override
	public void run(){
		consume();
	}
	private void consume(){
	   while(true){
		   try {
			queue.take();
			System.out.println("after take size:"+queue.size());
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	   }	
	}
}
